<#include "include/_meta.html">
<title>车辆审核列表</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 管理员管理 <span
            class="c-gray en">&gt;</span> 管理员列表 <a class="btn btn-success radius r"
                                                   style="line-height:1.6em;margin-top:3px"
                                                   href="javascript:location.replace(location.href);" title="刷新"><i
                class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
    <div class="text-c">
        车牌号码：
        <input type="text" class="input-text" style="width:250px" placeholder="车牌号码" id="carcode" name="carcode">
        车主手机：
        <input type="text" class="input-text" style="width:250px" placeholder="车主手机" id="mobile" name="mobile">

        <button type="submit" class="btn btn-success" id="searchCars" name=""><i class="Hui-iconfont">&#xe665;</i> 查询
        </button>
    </div>
    <div class="cl pd-5 bg-1 bk-gray mt-20"><span class="r">共有数据：<strong id="pageTotal">0</strong> 条</span></div>
    <div id="carList">
        <table id="checkListTable" class="table table-border table-bordered table-bg table-hover">
            <thead>
            <tr>
                <th scope="col" colspan="11">新车审核列表</th>
            </tr>
            <tr class="text-c">
                <th>序号</th>
                <th>车牌号码</th>
                <th>车辆颜色</th>
                <th>车主姓名</th>
                <th>车主手机</th>
                <th>车辆品牌</th>
                <th>品牌型号</th>
                <th>车辆类型</th>
                <th>车辆状态</th>
                <th>申请时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <tr class="text-c" v-for="(car,index) in cars">
                <td>{{index + 1}}</td>
                <td>{{car.carcode}}</td>
                <td>{{car.carcolor}}</td>
                <td v-if="car.clientuser">{{car.clientuser.name}}</td>
                <td v-else></td>
                <td v-if="car.clientuser">{{car.clientuser.mobile}}</td>
                <td v-else></td>
                <td v-if="car.clientuser">{{car.clientuser.idcard}}</td>
                <td v-else></td>
                <td>{{car.carbrandtype}}</td>
                <td>{{car.cartype}}</td>
                <td>{{car.carstate==1? "未审查":"审查"}}</td>
                <td>{{car.carOrderTime}}</td>
                <td>
                    <a href="#" @click="edit(car.carid)">审查</a>
                </td>
            </tr>
            <tr>
                <td colspan="3">
                    <div id="pagenav"></div>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
</div>

<#include "include/_footer.html">

<script type="text/javascript">

    $(function () {
        initTable();
    });

    var carListVue = new Vue({
        el: '#carList',
        data: {
            cars: []
        }
    });

    var initTable = function (curr) {


        $.ajax({
            contentType: "application/json",
            method: "get",
            url: "/checkcars/query",
            data: {
                carcode: $("#carcode").val(),
                mobile: $("#mobile").val(),
                pageNo: curr || 1,
                pageSize: 5
            },
            success: function (data) {

                console.log(data);
                carListVue.cars = data.list;
                laypage({
                    cont: "pagenav",
                    pages: data.totalPage,
                    skin: "#DB7023",
                    first: "首页",
                    last: "最后一页",
                    curr: curr || 1,
                    jump: function (obj, first) {
                        if (!first) {
                            initTable(obj.curr);
                        }
                    }
                });
            }
        })
    }
    $("#searchCars").click(function () {
        initTable();
    });

    /*审查信息*/
    var edit=function (carid) {
        layer.open({
            type:2,
            title:"审查",
            fix:false,
            maxmin:true,
            shadeClose:true,
            area:['800px','400px'],
            content:"/checkcars/edit?carid=" + carid,
            end:function () {
                initTable();
            }
        })
    }


</script>
</body>
</html>
